package com.lfy.spring.config;

import com.lfy.spring.bean.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * @author leifengyang
 * @version 1.0
 * @date 2025/8/9 20:11
 * @description:
 *
 * 自定义环境标识。不说，默认是:default
 */
@Configuration
public class AppConfig {


    @Profile("default")
    @Bean
    public Person person3(){
        Person person = new Person();
        person.setName("王五");
        person.setAge(30);
        return  person;
    }


    @Profile("test")
    @Bean
    public Person person2(){
        Person person = new Person();
        person.setName("张三");
        person.setAge(30);
        return  person;
    }


    @Profile("dev")
    @Bean
    public Person person1(){
        Person person = new Person();
        person.setName("李四");
        person.setAge(30);
        return  person;
    }
}
